package com.wpam.scrabble.mobile.activities;

import android.bluetooth.BluetoothDevice;

public class PlayerInfo {
	
	private final BluetoothDevice device_;
	private boolean accepted_;
	private boolean ready_;
	
	public PlayerInfo(BluetoothDevice device) {
		
		this.device_ = device;
		this.accepted_ = false;
		this.ready_ = false;
	}
	
	@Override
	public boolean equals(Object o) {
		try {
			PlayerInfo p = (PlayerInfo) o;
			return (this.device_.getAddress().equals(p.device_.getAddress()) && this.device_.getName().equals(p.device_.getName()));
		} catch (ClassCastException e) {
			return false;
		}
	}

	public void setAccepted(boolean stat) {
		this.accepted_ = stat;
	}
	
	public boolean isAccepted() {
		return accepted_;
	}
	
	public void setReady(boolean ready) {
		this.ready_ = ready;
	}
	
	public boolean isReady() {
		return ready_;
	}
	
	public String getName() {
		return device_.getName();
	}
}
